package com.petshop.controller;

import com.petshop.service.VoucherOrderService;
import com.petshop.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/voucher-order")
@CrossOrigin
public class VoucherOrderController {
    @Autowired
    private VoucherOrderService voucherOrderService;

    @PostMapping("/secKill/{id}")
    public Result secKillVoucher(@PathVariable("id") Long voucherId) throws InterruptedException {
        Result result = voucherOrderService.seckillVoucher(voucherId);
        return result;
    }
}
